package com.goldsign.pay.feign.api.sample.facade;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.goldsign.pay.feign.api.sample.fallback.HystrixFallbackFactory;

@FeignClient(name="service-sample", /*fallback=SampleFacade.Hystrix.class ,*/ fallbackFactory=HystrixFallbackFactory.class)
public interface SampleFacade {
	
	@RequestMapping(method={RequestMethod.POST}  ,value = "/sample/list")
	public String list(String id);
	
	
	@RequestMapping(method={RequestMethod.GET}  ,value = "/user/list")
	public String test(String id);
	
	
/*	@Component
	class Hystrix implements SampleFacade{
		@Override
		public String list(String id) {
			System.out.println("==========call fallback list=========");
			return "fallback list:" + id;
		}

		@Override
		public String test(String id) {
			System.out.println("==========call fallback test=========");
			return "fallback test:"  + id;
		}
	}*/
	
}
